import suds
SIZE = 50
client = suds.client.Client('http://184.73.196.191:9540/workqueue?wsdl')
f = open('/home/arthurkok/src/url_py/urllist_1M')
a = 0
list = []
for line in f:
  try:
    list.append(unicode(line.rstrip()))
    if len(list) == SIZE:
      client.service.addPacket(list)
      list = []
      print a
      a += 1
  except:
    continue

while True:
  if len(list) == SIZE:
    break
  elif list == []:
    break
  list.append(unicode('www.google.com'))

print list
if len(list) == SIZE:
  client.service.addPacket(list)

f.close()
